<template>
  <div style="overflow: auto; height: 100%; padding: 26px 36px">
    <div style="display: flex; flex-wrap: wrap">
      <div v-for="item, index in items" :key="index">
        <div v-if="permissions.find(x => x == item.toPage)" style="
            display: flex;
            align-items: center;
            width: 244px;
            height: 90px;
            background: #f9f9f9;
            margin-right: 23px;
            padding: 22px;
            box-sizing: border-box;
            margin-bottom: 20px;
          ">
          <div style="
              width: 48px;
              height: 48px;
              border-radius: 5px;
              display: flex;
              align-items: center;
              justify-content: center;
              margin-right: 15px;
              cursor: pointer;
            " @click="toPage(item.toPage)" :style="{ background: colors[index % 4] }">
            <div style="
                font-family: AlimamaShuHeiTi, AlimamaShuHeiTi;
                font-weight: bold;
                font-size: 22px;
                color: #ffffff;
                line-height: 26px;
                text-align: left;
                font-style: normal;
              ">
              {{ item.name.substring(0, 1) }}
            </div>
          </div>
          <div style="
              font-family: PingFangSC, PingFang SC;
              font-weight: 500;
              font-size: 12px;
              color: #333333;
              line-height: 22px;
              text-align: left;
              font-style: normal;
            ">
            {{ item.name }}
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
  computed: {
    ...mapGetters({
      permissions: 'user/permissions',
    })
  },
  data: function () {
    return {
      items: [{
        name: '案件导出',
        toPage: 'casePage'
      }, {
        name: '日志导出(未实现)',
      }, {
        name: '出差补贴导出',
        toPage: 'travelPage'
      }, {
        name: '外勤提成导出',
        toPage: 'outworkerIncomePage'
      }, {
        name: '内勤提成导出',
        toPage: 'inworkerIncomePage'
      }, {
        name: '开票导出',
        toPage: 'caseBillPage'
      }, {
        name: '回款导出',
        toPage: 'caseBillReturnPage'
      }, {
        name: '未回款导出',
        toPage: 'caseBillUnReturnPage'
      }, {
        name: '坏账导出',
        toPage: 'caseBillBadDeftPage'
      }],
      colors: ['#FF6C40', '#35C9B7', '#4089FF', '#00BF56'],
    }
  },
  methods: {
    toPage(page) {
      this.$router.push({
        name: page,
      })
    },
  },
  created: function () {
  },
}
</script>
<style scoped></style>
